package puzzle.projecteuler.p200;



public class Problem136 {

	/**
	 * 参考Problem135的分析
	 * @param args
	 */
	public static void main(String[] args) {

		long start = System.currentTimeMillis();
		int X = 50000000;
		int M = (int)Math.sqrt(3*X);
		int[] array = new int[X];
		for (int s = 1; s <= M; s ++) {
			for (int t = 4*(int)Math.floor(s/12) + (4 - s%4); t <= X/s; t += 4) {
				int n = s*t;
				if (3*t > s && n < X && n > 0) {
					array[n] ++;
				}
			}
		}
		int count = 0;
		for (int i = 0; i < X; i ++) {
			if (array[i] == 1) {
				count  ++;
			}
		}
		System.out.println(count);
		System.out.println((System.currentTimeMillis()-start) + " ms");
	}
}
